package com.ny.controller;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Controller
public class TestController {

    @RequestMapping("/index")
    public String test(HttpServletRequest request){
        request.setAttribute("username","hyz");
        return "index"; //对应webapp/index.jsp
    }
}
